import { Controller, Post, Body } from '@nestjs/common';
import { UserLoginDTO } from './user.dto'
import { UserService } from './user.service'
import * as db from '../../entity'

@Controller('user')
export class UserController {
    constructor(private readonly userService: UserService) { }

    @Post('user.login')
    userLogin(@Body() userLogin: UserLoginDTO) {
        return this.userService.userLogin(userLogin, db.UserTokenTypeEnum.USER);
    }

    @Post('crediter.login')
    crediterCodeSend(@Body() userLogin: UserLoginDTO) {
        return this.userService.userLogin(userLogin, db.UserTokenTypeEnum.CREDITER);
    }
}